<!-- 移动端任务详情 -->

<template>
  <EasyModal v-model="model" v-bind="MAP.MODEL_PROPS" :title="`${GETTER.title}详情`" noConfirm>
    <WebShow>
      <div class="DetailRepair-RepairInfo">
        <TaskBase />
        <TaskDevice v-if="one.planBizType === 1" />
        <TaskRegion v-else />
      </div>

      <TaskRecord class="DetailRepair-RepairRecord" />
    </WebShow>

    <DeviceModal />
  </EasyModal>
</template>

<script>
// ============================== 导入依赖 ============================== //

import CORE from '@/CORE'
import store from './store'
import props from './props'
import mixDetail from '@admin/components/detail/mixDetail'

// ============================== 导出组件 ============================== //

export default {
  /**
   * 名称定义 (实际使用名称)
   */
  name: 'DetailTaskApp',

  /**
   * 混入列表 (配置选项合并)
   */
  mixins: [CORE.mixStore(store), mixDetail],

  /**
   * 组件导入 (Abc.vue + Abc/index.vue)
   */
  ...CORE.components(
    require.context('@admin/components/detail/DetailTask', true, /vue$/),
    require.context('./', true, /vue$/),
  ),

  /**
   * 属性注册 (抽取以便查阅)
   */
  props,

  /**
   * 监听属性 (深度 deep 首次 immediate)
   */
  watch: {
    /**
     * 监听未处理设备的修改就绪
     */
    device2_readyEdit(ready) {
      if (ready) {
        this.startOne()
        this.$emit('change') // 触发更新事件
      }
    },
  },
}
</script>
